Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Creating Geometric Shapes


GXNewShapeVector

You can use the GXNewShapeVector function to create a new shape of any type.

void GXNewShapeVector(gxShapeType aType, const Fixed vector[]);
aType
A reference to the shape whose geometry you want to change.
vector
An array of fixed-point values to use as the new geometry.
function result
A reference to the new shape.
DESCRIPTION
The GXNewShapeVector function copies the default shape of the shape type specified by the aType parameter, sets the owner count of the new shape to 1, initializes its geometry with the values in the vector parameter, and returns a reference to it as the function result.

Although this function creates a copy of the default shape, it does not create a copy of the default shape's style, ink, or transform. The new shape returned by this function contains references to same style, ink, and transform as the default shape. You can change the style using functions from Chapter 3, "Geometric Styles," and you can change the style, ink, and transform using functions from Inside Macintosh: QuickDraw GX Objects.

You may pass any number of values in the vector array; the GXNewShapeVector function traverses this array as necessary to initialize the new shape's geometry. If you pass too few values in this parameter, the function posts the warning extra_data_passed_was_ignored.

If you specify a shape type that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape typeAction taken
bitmapCreates a bitmap shape; expects the vector array to contain values corresponding to the fields of a bitmap structure
pictureCreates a picture shape with no overriding styles, inks, or transforms; expects the vector array to contain an array of shape references
textPosts the error graphic_type_does_not_contain_points
glyphPosts the error graphic_type_does_not_contain_points
layoutPosts the error graphic_type_does_not_contain_points

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
parameter_is_nil 
number_of_points_exceeds_implementation_limit 
number_of_contours_exceeds_implementation_limit 
size_of_polygon_exceeds_implementation_limit 
size_of_path_exceeds_implementation_limit 
illegal_type_for_shape(debugging version)
count_is_less_than_one (debugging version)
shape_access_not_allowed (debugging version)
graphic_type_does_not_contain_points(debugging version)
Warnings 
extra_data_passed_was_ignored 
SEE ALSO
For general information about each type of geometry, see "About Geometric Shapes" on page 2-5. For specific definitions of each type of geometry, see the section "Data Types" beginning on page 2-104.

For information about related functions, see the descriptions of the GXNeWPoint, GXNeWLine, GXNeWCurve, GXNeWRectangle, GXNeWPolygons, and GXNeWPaths functions on page 2-111 through page 2-119.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help